/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.unioeste.cc.gui;

import java.awt.Graphics;
import java.awt.Image;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 *
 * @author diego
 */
public class Teste extends JFrame {
    
//    Image im = new ImageIcon(getClass().getResource("via.png")).getImage(); 

//    public void paintComponent( Graphics g )     
//    {     
//        super.paintComponent(g);     
//        int x = (this.getWidth() - im.getWidth(null)) / 2;     
//        int y = (this.getHeight() - im.getHeight(null)) / 2;     
//        g.drawImage(im , x , y , this);     
//    }   
    
    public Teste() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(1050, 650);
        setLocation(50, 50);
        setTitle("Máquina Virtual Monociclo");
        setIconImage(new ImageIcon("logo.jpeg").getImage());
        
        JPanel panel = new JPanel() {

            public void paintComponent(Graphics g) {
                super.paintComponent(g);
                Image imagem = new ImageIcon("via.png").getImage();
                g.drawImage(imagem, 0, 0, this);
            }
        };
        getContentPane().add(panel);
        
    }

    public static void main(String[] args) {
        new Teste().setVisible(true);
    }
}
